********************************************************************************
/*								RESULTS

	Project: (Mis)perception of Party Congruence and Satisfaction with Democracy
	
	Date: 	May 2024
	
	Purpose: 	Obtain the results for the main part of the paper and the 
				appendix 
				
				
	Part A:		 	
    Inputs:   cleaned_BES_final.dta;
	          cleaned_BES_complete_mean_final; 
			  cleaned_BES_complete_knowledge_final;      
			  
    Outputs from part A in sequence:	1. Figure 2 - THE DISTRIBUTIONS OF MISPERCEPTION (BES WAVE 7)
	                        2. Table 1 - REGRESSION PARTY MISPERCEPTION ON PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE, BES PANEL
							3. Table 2 - PANEL REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, BES PANEL
				            4. Figure 4 - PREDICTED EFFECTS OF PERCEIVED AND ACTUAL PARTY-VOTERS INCONGRUENCE ON DEMOCRATIC SATISFACTION
							
							Appendix:
				            5. Appendix table C.4 - PANEL REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, BES PANEL
                            6. Appendix table C.6 - REGRESSION ON PARTY MISPERCEPTION FOR PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE WITH CONTROLS, POOLED
	                        7. Appendix table C.7 - REGRESSION ON PERCEIVED AND ACTUAL INCONGRUENCE FOR SATISFACTION WITH DEMOCRACY WITH CONTROLS			
							8. Appendix table C.9 - PANEL REGRESSION: DYNAMICS BETWEEN SATISFACTION AND (ACTUAL AND PER-CEIVED) INCONGRUENCES, BES PANEL
							9. Appendix table C.10 - PANEL REGRESSION: CHANGE IN SATISFACTION WITH DEMOCRACY AND (PERCEIVED AND ACTUAL) INCONGRUENCE, BES PANEL	
                           10. Appendix table C.11 - PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION WITH DEMOCRACY: AN INSTRUMENTAL VARIABLE APPROACH							
						   11. Appendix tables C.13-C.16 - Tables on INCONGRUENCE - REDISTRIBUTION; INCONGRUENCE - IMMIGRATION; INCONGRUENCE - EU INTEGRATION; INCONGRUENCE - ENVIRONMENTAL GROWTH
						   12. Appendix tables C.17-C.20 - Tables on SATISFACTION - REDISTRIBUTION; SATISFACTION - IMMIGRATION; SATISFACTION - EU INTEGRATION; SATISFACTION - ENVIRONMENTAL GROWTH
						   13. Appendix table C.21 - REGRESSION PARTY MISPERCEPTION ON PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE, BES PANEL USING AVERAGE PERCEIVED POSITIONS		
						   14. Appendix table C.22 - PANEL REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, BES PANEL USING AVERAGE PERCEIVED POSITIONS
						   15. Appendix table C.23 - REGRESSION PARTY MISPERCEPTION ON PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE, BES PANEL USING AVERAGE PERCEIVED POSITIONS BY HIGHER EDUCATED VOTERS
						   16. Appendix table C.24 - PANEL REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, BES PANEL USING AVERAGE PERCEIVED POSITIONS BY HIGHER EDUCATED VOTERS	
						   17. Appendix tables C.25 - CORRELATES OF VOTERS' MISPERCEPTION OF OWN PARTIES		
	Part B:						   
    Inputs: cses_final.dta    
	
    Outputs from part B in sequence:	1. Table 3 - REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, EUROPEAN DEMOCRACIES (CSES)
				            2. Figure 5 - CSES: PREDICTED EFFECTS OF PERCEIVED AND ACTUAL PARTY-SUPPORTER INCONGRUENCE ON DEMOCRATIC SATISFACTION
							
							Appendix:
				            3. Table C.5: REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, EUROPEAN DEMOCRACIES (CSES)
							4. Table C.8: REGRESSION PARTY MISPERCEPTION ON PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE, CSES
 					   
						   
	Part C:						   
    Inputs: BES_rescale.dta  
	
	Outputs from part C in sequence:	Appendix: 1. Table C.12: PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION WITH DEMOCRACY: LATENT IDEOLOGICAL MEASURE				   
		 			
				
*/
********************************************************************************
//------------------------------------------
//------------------------------------------
//         Setup and data preparation
//------------------------------------------
//------------------------------------------

clear
global sDIR = "/Users/litang/Library/CloudStorage/Dropbox/income inequality politics/new/stata/new codes/PSRM replication" // here to change to your folder location
cd "$sDIR"
use "$sDIR/cleaned_BES_final.dta"

sort  id wave
merge id wave using "$sDIR/cleaned_BES_complete_mean_final.dta", keep(act_incongruence_mean own_misp2_mean dev_centre_mean polar_mean perc_incongruence_mean)
drop _merge

sort  id wave
merge id wave using "$sDIR/cleaned_BES_complete_knowledge_final.dta", keep(act_incongruence_knowledge own_misp2_knowledge dev_centre_knowledge polar_knowledge perc_incongruence_knowledge)
drop _merge

log using "$sDIR/03_MispercSat_output.log", replace

xtset id wave
global samp_cond = " p_edlevel != . & partyId != . & gender != . & polAttention!= . & numberSource != . & jobzone != ."

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------
//                                               Part A
//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

//---------------------------------------------- ---------
//	Figure 2 - THE DISTRIBUTIONS OF MISPERCEPTION (BES WAVE 7)
//---------------------------------------------------------
// histogram of distribution of misperception in wave 7
histogram own_misp2 if wave == 7 & inlist(generalElectionVote,1,2,3), normal bin(15)  title("") xtitle("Misperception") ytitle("Shares") plotregion(fcolor(white)) graphregion(fcolor(white))
graph export "$sDIR/figure2_histogram.pdf", replace
//----------------------------------------------------------------------------------------------------------------------
//	table 1 - REGRESSION PARTY MISPERCEPTION ON PERCEIVED AND ACTUAL VOTER-PARTY INCON- GRUENCE, BES PANEL
//----------------------------------------------------------------------------------------------------------------------

xtreg act_incongruence own_misp dev_centre polar ibn.wave , fe vce(r)
xtreg perc_incongruence  own_misp dev_centre polar ibn.wave, fe vce(r)
xtreg perc_incongruence  own_misp act_incongruence  dev_centre polar ibn.wave, fe vce(r)


//----------------------------------------------------------------------------------------
//	table 2 - PANEL REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, BES PANEL
//----------------------------------------------------------------------------------------

xtreg satisfy  act_incongruence ibn.wave , fe vce(r)
xtreg satisfy perc_incongruence  act_incongruence ibn.wave, fe vce(r)

//----------------------------------------------------------------------------------------------------------------------
//	Figure 4 - PREDICTED EFFECTS OF PERCEIVED AND ACTUAL PARTY-VOTERS INCONGRUENCE ON DEMOCRATIC SATISFACTION
//----------------------------------------------------------------------------------------------------------------------
//left plot
summarize perc_incongruence
global MyMin = r(min)
global MyMax = r(max)
global Grid = ($MyMax-$MyMin)/5
quietly margins , at(c.perc_incongruence=($MyMin ($Grid) $MyMax))
marginsplot, recast(line) recastci(rarea) title("") xtitle("Perceived Incongruence") ytitle("Satisfaction with Democracy (semi-standardized)") plot1opts(lcolor(black)) yscale(r(-0.35 (0.05) -0.1))  ylabel(-0.35 (0.05) -0.1) plotregion(fcolor(white)) graphregion(fcolor(white))
graph export "$sDIR/figure4_left.pdf", replace

//right plot
summarize act_incongruence
global MyMin = r(min)
global MyMax = r(max)
global Grid = ($MyMax-$MyMin)/5
quietly margins , at(c.act_incongruence=(0 (2) 10))
marginsplot, recast(line) recastci(rarea) title("") xtitle("Actual Incongruence") ytitle("Satisfaction with Democracy (semi-standardized)") plot1opts(lcolor(black)) yscale(r(-0.35 (0.05) -0.1))  ylabel(-0.35 (0.05) -0.1) plotregion(fcolor(white)) graphregion(fcolor(white))
graph export "$sDIR/figure4_right.pdf", replace
graph drop _all 

//---------------------------------------------------------
//                  Appendix related to part A
//---------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
//	Appendix table C.4 - Panel regression of satisfaction on actual and/or perceived incongruence
//------------------------------------------------------------------------------------------------------------

xtreg satisfy  act_incongruence ibn.wave , fe vce(r)
xtreg satisfy perc_incongruence  act_incongruence ibn.wave, fe vce(r)
xtreg satisfy perc_incongruence  act_incongruence own_misp ibn.wave, fe vce(r)

//----------------------------------------------------------------------------------------------------------------------------------
// Appendix table C.6 - REGRESSION ON PARTY MISPERCEPTION FOR PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE WITH CONTROLS, POOLED
//----------------------------------------------------------------------------------------------------------------------------------

reg act_incongruence own_misp dev_centre polar ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote  ibn.gender c.polAttention c.numberSource i.jobzone if $samp_cond, r
reg perc_incongruence  own_misp dev_centre polar ibn.wave i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote  ibn.gender c.polAttention c.numberSource i.jobzone if $samp_cond , r
reg perc_incongruence  own_misp act_incongruence  dev_centre polar ibn.wave i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone  if $samp_cond, r

//--------------------------------------------------------
// Appendix table C.7 - REGRESSION ON PERCEIVED AND ACTUAL INCONGRUENCE FOR SATISFACTION WITH DEMOCRACY WITH CONTROLS
//---------------------------------------------------------

ologit satisfy act_incongruence  own_misp  polar ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone  if $samp_cond, cluster(id)
ologit satisfy perc_incongruence act_incongruence  own_misp  polar ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone  if $samp_cond, cluster(id)
reg satisfy act_incongruence own_misp  polar  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone  if $samp_cond, cluster(id)
reg satisfy perc_incongruence act_incongruence own_misp polar  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone  if $samp_cond, cluster(id)

//-------------------------
//	Appendix table C.9 - PANEL REGRESSION: DYNAMICS BETWEEN SATISFACTION AND (ACTUAL AND PER-CEIVED) INCONGRUENCES, BES PANEL
//-------------------------

xtreg satisfy L.act_incongruence  i.year if lag_partyId_check == 0, fe vce(r) 
xtreg satisfy L.act_incongruence L.perc_incongruence  i.year if lag_partyId_check == 0, fe vce(r) 
xtreg satisfy L.satisfy perc_incongruence L.perc_incongruence  act_incongruence L.act_incongruence if lag_partyId_check == 0, fe vce(r)

//----------------------
// Appendix Table C.10 - PANEL REGRESSION: CHANGE IN SATISFACTION WITH DEMOCRACY AND (PERCEIVED AND ACTUAL) INCONGRUENCE, BES PANEL
//----------------------

gen D_sat = D.satisfy

xtreg D_sat perc_incongruence act_incongruence  L.satisfy ibn.wave if lag_partyId_check == 0, fe r
xtreg D_sat L.perc_incongruence L.act_incongruence L.satisfy ibn.wave if lag_partyId_check == 0, fe r

//-----------------------
// Appendix table C.11 - PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION WITH DEMOCRACY: AN INSTRUMENTAL VARIABLE APPROACH
//-----------------------

xtset id wave

reg perc_incongruence  overall_know  act_incongruence  i.wave ib2.p_edlevel earn_q3   if inlist(wave, 10,11,15,16,17), r
test   overall_know
predict xb_pol_v2, xb
gen inst = normalden(-xb_pol_v2) / normal(-xb_pol_v2)

reg satisfy inst act_incongruence i.wave ib2.p_edlevel earn_q3 if inlist(wave, 10,11,15,16,17) , cluster(dev_centre)
ologit satisfy inst  act_incongruence i.wave ib2.p_edlevel earn_q3 if inlist(wave, 10,11,15,16,17) , cluster(dev_centre) 

//--------------------------------------------------------
// Appendix tables C.13 - C.16: Tables on INCONGRUENCE - REDISTRIBUTION; INCONGRUENCE - IMMIGRATION; INCONGRUENCE - EU INTEGRATION; INCONGRUENCE - ENVIRONMENTAL GROWTH
//--------------------------------------------------------

//redistribution
reg act_incongruence misper2_redist ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg perc_incongruence misper2_redist ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg perc_incongruence misper2_redist act_incong_redist ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r	

// immigration
reg act_incongruence misper2_immig ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg perc_incongruence misper2_immig ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg perc_incongruence misper2_immig  act_incong_immig ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone , r
		
// EU integration
reg act_incongruence misper2_EUIntegration  ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource, r
reg perc_incongruence misper2_EUIntegration ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg perc_incongruence misper2_EUIntegration act_incong_EUIntegration ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r

// Enviro growth
reg act_incongruence misper2_enviroGrowth ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg perc_incongruence misper2_enviroGrowth ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r 
reg perc_incongruence misper2_enviroGrowth act_incong_enviroGrowth ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r

//------------------------------------
// Appendix tables C.17 - C.20:  Tables on SATISFACTION - REDISTRIBUTION; SATISFACTION - IMMIGRATION; SATISFACTION - EU INTEGRATION; SATISFACTION - ENVIRONMENTAL GROWTH			
//------------------------------------

// immigration
reg satisfy act_incong_immig ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg satisfy act_incong_immig perc_incong_immig ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r

// redistribution
reg satisfy act_incong_redist ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg satisfy act_incong_redist perc_incong_redist ibn.wave  i.earn_q3 c.age##c.age  ibn.wave ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r

// EU integration
reg satisfy act_incong_EUIntegration, r
reg satisfy act_incong_EUIntegration perc_incong_EUIntegration, r

// Enviro growth
reg satisfy act_incong_enviroGrowth ibn.wave  i.earn_q3 c.age##c.age  ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource i.jobzone, r
reg satisfy act_incong_enviroGrowth perc_incong_enviroGrowth  i.earn_q3 c.age##c.age ib2.p_edlevel ibn.generalElectionVote ibn.gender c.polAttention c.numberSource, r

//------------------------------------
// Appendix Table C.21 - REGRESSION PARTY MISPERCEPTION ON PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE, BES PANEL USING AVERAGE PERCEIVED POSITIONS			
//------------------------------------

xtreg act_incongruence_mean own_misp2_mean dev_centre_mean polar_mean ibn.wave , fe vce(r)
xtreg perc_incongruence_mean own_misp2_mean dev_centre_mean polar_mean ibn.wave , fe vce(r)
xtreg perc_incongruence_mean  own_misp2_mean act_incongruence_mean  dev_centre_mean polar_mean ibn.wave, fe vce(r)

//------------------------------------
// Appendix Table C.22 - PANEL REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, BES PANEL USING AVERAGE PERCEIVED POSITIONS			
//------------------------------------

xtreg satisfy  act_incongruence_mean ibn.wave  dev_centre , fe vce(r)
xtreg satisfy  perc_incongruence_mean  act_incongruence_mean ibn.wave dev_centre, fe vce(r)

//------------------------------------
// Appendix Table C.23 - REGRESSION PARTY MISPERCEPTION ON PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE, BES PANEL USING AVERAGE PERCEIVED POSITIONS BY HIGHER EDUCATED VOTERS			
//------------------------------------

xtreg act_incongruence_knowledge  own_misp2_knowledge dev_centre_knowledge polar_knowledge ibn.wave , fe vce(r)
xtreg perc_incongruence_knowledge own_misp2_knowledge dev_centre_knowledge polar_knowledge ibn.wave , fe vce(r)
xtreg perc_incongruence_knowledge own_misp2_knowledge act_incongruence_knowledge  dev_centre_knowledge polar_knowledge ibn.wave, fe vce(r)

//------------------------------------
// Appendix Table C.24 - PANEL REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, BES PANEL USING AVERAGE PERCEIVED POSITIONS BY HIGHER EDUCATED VOTERS			
//------------------------------------

xtreg satisfy  act_incongruence_knowledge ibn.wave  dev_centre , fe vce(r)
xtreg satisfy  act_incongruence_knowledge perc_incongruence_knowledge ibn.wave dev_centre, fe vce(r)

//--------------------------------------------------------
// Appendix table D.25 CORRELATES OF VOTERS' MISPERCEPTION OF OWN PARTIES
//--------------------------------------------------------
reg own_misp partyIdStreng ibn.wave i.earn_q3 c.age ib2.p_edlevel c.polAttention c.numberSource, r
reg own_misp partyIdStreng ibn.wave i.earn_q3 c.age ib2.p_edlevel ibn.gender c.polAttention c.numberSource i.jobzone  ibn.generalElectionVote, r

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------
//                                               Part B
//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------
clear
use "$sDIR/cses_final.dta"
// income, gender, education, marriage, employment, HHsize, year, country
global ind_contr = "dev_centre polar i.E2010 i.E1029 i.E2003 i.E2004 i.E2006  i.E1008 i.country i.E2013 i.E5050 "
global samp_cond = " E2010 <= 5 & country != .  "

//--------------------------------------------------------
// Table 3: REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, EUROPEAN DEMOCRACIES (CSES)
//--------------------------------------------------------
//satisfy no control for misperception
reg satisfy  act_incongruence $ind_contr if $samp_cond , r
reg satisfy  perc_incongruence act_incongruence $ind_contr   if $samp_cond , r

//----------------------------------------------------------------------------------------------------------------------
// Figure 5 - PREDICTED EFFECTS OF PERCEIVED AND ACTUAL PARTY-VOTERS INCONGRUENCE ON DEMOCRATIC SATISFACTION
//----------------------------------------------------------------------------------------------------------------------
//left plot
summarize perc_incongruence
global MyMin = r(min)
global MyMax = r(max)
global Grid = ($MyMax-$MyMin)/5
quietly margins , at(c.perc_incongruence=($MyMin ($Grid) $MyMax))
marginsplot, recast(line) recastci(rarea) title("") xtitle("Perceived Incongruence") ytitle("Satisfaction with Democracy (semi-standardized)") plot1opts(lcolor(black)) yscale(r(-0.2 (0.1) 0.5))  ylabel(-0.2 (0.1) 0.5) plotregion(fcolor(white)) graphregion(fcolor(white))
graph export "$sDIR/figure5_left.pdf", replace

//right plot
summarize act_incongruence
global MyMin = r(min)
global MyMax = r(max)
global Grid = ($MyMax-$MyMin)/5
quietly margins , at(c.act_incongruence=(0 (2) 10))
marginsplot, recast(line) recastci(rarea) title("") xtitle("Actual Incongruence") ytitle("Satisfaction with Democracy (semi-standardized)") plot1opts(lcolor(black)) yscale(r(-0.2 (0.1) 0.5))  ylabel(-0.2 (0.1) 0.5) plotregion(fcolor(white)) graphregion(fcolor(white))
graph export "$sDIR/figure5_right.pdf", replace

//----------------------------------
//   Appendix related to part B
//----------------------------------
//--------------------------------------------------------
// Table C.5: REGRESSION: EFFECTS OF PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION, EUROPEAN DEMOCRACIES (CSES)
//--------------------------------------------------------
reg satisfy  act_incongruence $ind_contr if $samp_cond , r
reg satisfy  act_incongruence perc_incongruence  $ind_contr   if $samp_cond , r
reg satisfy  act_incongruence perc_incongruence own_misp $ind_contr   if $samp_cond , r

//--------------------------------------------------------
// Table C.8: REGRESSION PARTY MISPERCEPTION ON PERCEIVED AND ACTUAL VOTER-PARTY INCONGRUENCE, CSES
//--------------------------------------------------------
reg act_incongruence  own_misp   $ind_contr  [aw =  E1010_2] if $samp_cond ,r
reg perc_incongruence  own_misp  $ind_contr  [aw =  E1010_2]  if $samp_cond , r
reg perc_incongruence  own_misp act_incongruence   $ind_contr [aw =  E1010_2] if $samp_cond , r

//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------
//                                               Part C
//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------
clear
use "$sDIR/BES_rescale.dta"
//--------------------------------------------------------
// Appendix Table C.12: PERCEIVED INCONGRUENCE AND ACTUAL INCONGRUENCE ON SATISFACTION WITH DEMOCRACY: LATENT IDEOLOGICAL MEASURE
//--------------------------------------------------------
xtreg satisfy act_incongruence  ibn.wave ibn.partyId, fe vce(r)
xtreg satisfy perc_incongruence act_incongruence  ibn.wave  ibn.partyId , fe vce(r)

log close

